package cn.johnyu.prsistencedemo;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

/**
 * Created by Administrator on 2016/3/20.
 */
public class JohnDbHelpler extends SQLiteOpenHelper {

    public JohnDbHelpler(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context,name,factory,version);

    }
    @Override
    public void onCreate(SQLiteDatabase db) {
        String ddl="create table users (id integer primary key autoincrement,uname text)";
        db.execSQL(ddl);

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        String ddl="create table users (id integer primary key autoincrement,uname text)";
        Log.i("john","upgrade.....");
    }
}
